<template>
  <uni-popup ref="popup">
    <view class="pop-content">
      <image
        class="logout-img"
        src="/static/agreement.png"
        mode="aspectFit"
      ></image>
      <text class="title">{{ title }}</text>
      <view class="con-box">
        <scroll-view class="con" scroll-y="true" show-scrollbar="true">
          <view class="hot"
            >采用权威数字证书、国家可信身份数据源，确保身份认证、核验结果可信，让每个异构系统都有真实身份支撑，解决身份可信问题。采用权威数字证书、国家可信身份数据源，确保身份认证、核验结果可信，让每个异构系统都有真实身份支撑，解决身份可信问题。采用权威数字证书、国家可信身份数据源，确保身份认证、核验结果可信，让每个异构系统都有真实身份支撑，解决身份可信问题。采用权威数字证书、国家可信身份数据源，确保身份认证、核验结果可信。</view
          >
        </scroll-view>
      </view>
      <view class="btn-group row">
        <view class="btn center red" @click="confirm">
          <text>{{ confirmText }}</text>
        </view>
      </view>
      <view class="btn-close" @click="close">
        <image
          class="close-img"
          src="/static/guanbi2-slices.png"
          mode="aspectFit"
        ></image>
      </view>
    </view>
  </uni-popup>
</template>

<script>
/**
 * 自定义 确认对话框
 * @prop title 标题
 * @prop text 提示内容
 * @prop confirmText 确认按钮文字
 * @event onConfirm 确认按钮点击时触发
 */
export default {
  data() {
    return {};
  },
  props: {
    title: {
      type: String,
      default: "运输协议",
    },
    confirmText: {
      type: String,
      default: "确定",
    },
  },
  methods: {
    confirm() {
      this.$emit("onConfirm");
      this.close();
    },
    open() {
      this.$refs.popup.open();
    },
    close() {
      this.$refs.popup.close();
    },
  },
};
</script>

<style scoped lang="scss">
.pop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 600rpx;
  padding-top: 36rpx;
  background-color: #fff;
  border-radius: 24rpx;
  // overflow: hidden;
  .logout-img {
    position: relative;
    top: -100rpx;
    width: 200rpx;
    height: 200rpx;
  }
  .title {
    margin-top: -100rpx;
    font-size: 42rpx;
    color: #333;
    line-height: 58rpx;
    font-weight: 700;
  }
  .con-box {
    margin: 40rpx;
    margin-left: 50rpx;
  }
  .con {
    height: 400rpx;
  }
  .hot {
    text-indent: 2em;
    width: 500rpx;
    font-size: 30rpx;
    color: #666;
    line-height: 44rpx;
  }
  .btn-group {
    width: 100%;
    padding-bottom: 20rpx;
  }
  .btn {
    position: relative;
    top: 0;
    flex: 1;
    height: 88rpx;
    line-height: 88rpx;
    font-size: 36rpx;
    color: #f55348;
    margin: 0 30rpx 20rpx;
    border-radius: 45px;

    &:last-child {
      color: #ffffff;
    }
  }
  .pink-mark {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 45px;
    background: linear-gradient(151deg, #f75248 0%, #f5473b 100%);
    height: 88rpx;
    width: 100%;
    opacity: 0.1;
  }
  .red {
    background: linear-gradient(151deg, #f75248 0%, #f5473b 100%);
  }
  .btn-close {
    position: relative;
    top: 0;
    .close-img {
      position: absolute;
      top: 50rpx;
      left: 50%;
      margin-left: -40rpx;
      width: 80rpx;
      height: 80rpx;
    }
  }
}
</style>
